package com.deer.wms.ASN.manage.model.asn;

import com.baomidou.mybatisplus.annotation.TableField;
import com.deer.wms.project.root.model.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * @author guo
 */
@Getter
@Setter
@NoArgsConstructor
@Table(name = "asn_master")

public class AsnMaster extends BaseEntity {

    private static final long serialVersionUID = 4170010760166199548L;
    /**
     * ASN单号
     */
    @Column(name = "bill_no")
    private String billNo;

    /**
     * ASN类型？？？
     */
    @Column(name = "bill_type")
    private Integer billType;

    /**
     * 采购单号
     */
    @Column(name = "request_buy_bill_no")
    private String requestBuyBillNo;

    /**
     * 状态   2-等待审核  1-审核通过 0-审核中 -1 -审核退回
     */
    private Integer state;

    /**
     * 优先级
     */
    @Column(name = "order_no")
    private Integer orderNo;

    /**
     * 仓库ID
     */
    @Column(name = "ware_id")
    private Integer wareId;

    /**
     * 仓库Code
     */
    @Column(name = "ware_code")
    private String wareCode;

    /**
     * 仓库名称
     */
    @Column(name = "ware_name")
    private String wareName;

    /**
     * 货主ID
     */
    @Column(name = "organization_id")
    private Integer organizationId;

    /**
     * 货主Code
     */
    @Column(name = "organization_code")
    private String organizationCode;

    /**
     * 货主名称
     */
    @Column(name = "organization_name")
    private String organizationName;

    /**
     * 创建人名称
     */
    @Column(name = "create_user_name")
    private String createUserName;

    /**
     * ASN状态  0-初始化 1-已码盘  2-部分收货  3-全部收货  4-ASN完成  5-超额收货
     */
    @Column(name = "asn_state")
    private Integer asnState;

    /**
     * 预期到货时间
     */
    @Column(name = "expect_time")
    private String expectTime;

    /**
     * 参考信息1
     */
    private String asnUdfHs1;

    /**
     * 参考信息2
     */
    private String asnUdfHs2;

    /**
     * 参考信息3
     */
    private String asnUdfHs3;

    /**
     * 供应商ID
     */
    @Column(name = "supplier_id")
    private Integer supplierId;

    /**
     * 供应商名称
     */
    @Column(name = "supplier_name")
    private String supplierName;

    /**
     * 供应商编码
     */
    private String supplierCode;

    /**
     * 承运方编码
     */
    @Column(name = "carrier_code")
    private String carrierCode;

    /**
     * 质检状态
     */
    @Column(name = "quality_state")
    private Integer qualityState;

    /**
     * 月台编码
     */
    @Column(name = "platform_code")
    private String platformCode;

    /**
     * 业务员
     */
    private String salesman;

    /**
     * 发货地
     */
    private String loadingPlace;

    /**
     * 交货地
     */
    private String deliveryPlace;

    /**
     * 运输描述
     */
    @Column(name = "traffic_describe")
    private String trafficDescribe;

    /**
     * 插入类型 0-提交  -2保存为草稿
     */
    @Column(name = "insert_type")
    private Integer insertType;

    /**
     * 单据来源类型  1-新建  0-采购单生成  2-供应商采购生成  3-供应商新建 4-导入
     */
    private Integer billSource;
    /**
     * 备注
     */
    /**
     * 原单号
     */
    private Integer beforeNum;
    private String memo;

    private Integer isSerialNo;
    /**
     * 是否打印
     */
    private Integer isPrint;

    private Integer asnType;
    /**
     * 调拨单号
     */
    private String allotBillNo;
    /**
     * 质检状态
     */
    private Integer qcState;
    @TableField(exist = false)
    private String dictValue;

    /**
     * 履约号--产成品入库
     * */
    @Column(name = "agreement_no")
    private String agreementNo;
    private Integer dispatch;

    //申请类型
    private String typeNo;
    //单据Id
    private Long documentId;
    //ASN单行ID
    private Long line;
    //组织Id
    private Long org;
    //ASN单行号
    private int erpLineNo;

    //聚源客户id
    private Integer customerId;
    /**
     * 获取预期到货时间
     *
     * @return expect_time - 预期到货时间
     */
    public String getExpectTime() {
        return expectTime;
    }

    /**
     * 设置预期到货时间
     *
     * @param expectTime 预期到货时间
     */
    public void setExpectTime(String expectTime) {
        if (expectTime == null || expectTime.equals("")) {
            this.expectTime = null;
        } else {
            this.expectTime = expectTime;
        }
    }

}